#! /bin/sh

. ./prelude

bspc monitor -a "test-sticky-a"
bspc monitor -a "test-sticky-b"

bspc desktop -f "test-sticky-a"

window add 3
bspc node -g sticky

sticky_node_id=$(bspc query -N -n)

bspc rule -a 'Blah\:\:2:test' -o desktop="test-sticky-b"

CLASS_NAME=Blah::2 INSTANCE_NAME=test window add

bspc desktop -f "test-sticky-b"

bspc query -N -d | grep "$sticky_node_id" > /dev/null || fail "Sticky node is missing in destination."

window remove 2
bspc desktop -f "test-sticky-a"
window remove 2

bspc desktop "test-sticky-a" -r
bspc desktop "test-sticky-b" -r
